<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>10.使用after和before制作绚丽的表单</title>
  <link rel="stylesheet" href="1.css">
  <style>

    body {
      padding: 50px;
    }
    .field {
      position: relative;
      margin-bottom: 10px;
    }
    input {
      border: none;
      outline: none;
      width: 100%;
      text-align: center;
      color: #555;
    }

    .field::after {
      content: "";
      background: linear-gradient(to right , red ,green ,blue);
      display: block;
      height: 1px;
    }

    .field:hover::before {
      content: attr(data-help);
      color: #666;
      font-size: 12px;
      position: absolute;
      top: -10px;
      text-align: center;
      width: 100%;
      
    }
    
  </style>
</head>

<body>
  <div class="field" data-help="请输入100以内的字符">
    <input type="text">
  </div>
  
  <div class="field" data-help="请输入100以内的字符">
    <input type="text">
  </div>
  
  <div class="field" data-help="请输入100以内的字符">
    <input type="text">
  </div>
  
</body>

</html>